package com.taotao.sso.service;

import java.io.IOException;

import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.taotao.sso.pojo.User;

public interface UserService {

	/**
	 * 验证用户名 邮箱 电话是否可用
	 * @param param
	 * @param type
	 * @return
	 */
	public Boolean checkUser(String param, Integer type) throws Exception;

	/**
	 * 用户注册方法
	 * @param user
	 * @return
	 */
	public Boolean register(User user);

	/**
	 * 实现登陆逻辑
	 * @param userName
	 * @param password
	 * @return
	 * @throws JsonProcessingException
	 */
	public String login(String userName, String password) throws JsonProcessingException;

	/**
	 * 根据token查询登陆状态
	 * @param token
	 * @return
	 * @throws JsonParseException
	 * @throws JsonMappingException
	 * @throws IOException
	 */
	public User queryUserByToken(String token) throws JsonParseException, JsonMappingException, IOException;

}
